package com.yonyou.pmclouds.reason.entity;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.basecom.util.CommonProgramConsts;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

@Data
@Table(name = "pmbd_problem_reason")
public class ProblemReasonVO extends SuperVO {
    public static final String PK_REASON = "pkReason";
    public static final byte CATEGORY_QUALITY = 0;
    public static final byte CATEGORY_SECURITY = 1;

    @NotNull(groups = ProblemReasonVO.UpdateValid.class)
    @Size(min = CommonProgramConsts.UUID_STRING_LENGTH,
            max = CommonProgramConsts.UUID_STRING_LENGTH, groups = ProblemReasonVO.UpdateValid.class)
    @Id
    private String pkReason;
    private String pkTenant;
    @NotNull(groups = ProblemReasonVO.InsertValid.class)
    @Size(min = 1, max = 50, groups = ProblemReasonVO.InsertValid.class)
    private String scode;
    @NotNull
    @Size(min = 1, max = 50)
    private String sname;
    /**
     * 问题原因类别，0：质量问题原因，1：安全问题原因
     */
    private byte category;
    private String pkParent;
    private String pkRoot;
    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;
    private byte enableStatus;

    @Transient
    private ProblemReasonVO[] childReason;
    @Transient
    private String pcode;

    public interface UpdateValid {
    }

    public interface InsertValid {
    }
}
